from langchain.llms.fake import FakeListLLM
from langchain.agents import load_tools,initialize_agent,AgentType
from langchain_experimental.utilities import PythonREPL
python_repl = PythonREPL()

tools = load_tools(['python_repl'])
response = ['Action:Python_ReplnAction Input:print(2+2)','Fnal answer:4']
llm = FakeListLLM(response=response)
agent = initialize_agent(
    tools=tools,llm=llm,agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,verbose=True
)
agent.run("what's s + 2")